<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ attribute name="id" type="java.lang.String" required="true" description="按钮ID"%>
<%@ attribute name="name" type="java.lang.String" required="true" description="按钮名称"%>
<%@ attribute name="className" type="java.lang.String" required="true" description="按钮css类名"%>
<%@ attribute name="objectId" type="java.lang.String" required="true" description="上传附件或图片对象ID"%>
<%@ attribute name="objectType" type="java.lang.String" required="true" description="上传附件或图片对象类型"%>
<%@ attribute name="callback" type="java.lang.String" required="false" description="上传完图片回调函数"%>
<div class="images-box dib" id="${id}Id">
	<i class="iconfont images-plus">&#xe641;</i>
	<input  value="${name}" type="button" class="${className}"/>
</div>

<script>
KindEditor.ready(function(K) {
	var editor = K.editor({
		allowFileManager : true
	});
	K('#${id}Id').click(function() {
		editor.loadPlugin('multiimage', function() {
			editor.plugin.multiImageDialog({
				clickFn : function(urlList) {
					var div = K('#${id}Id');
					div.html('');
					K.each(urlList, function(i, data) {
						div.append('<img src="' + data.url + '">');
					});
					editor.hideDialog();
				}
			});
		});
	});
});
</script>